﻿<%@ Page Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="RegionDetail.aspx.cs" Inherits="MockPrjTeam1.Pages.Views.RegionDetail" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="templatemo_main">
        <table width="100%" cellspacing="0" id="table1">
            <tr height="50">
                <td colspan="3" style="font-size:large; color:green">Trust Region Details</td>
            </tr>            
            <tr>
                <td width="6%" style="border-width: thin; border-style: groove groove none groove;" align="center" valign="middle">Details                 
                </td>
                <td id="districtTab" width="10%" style="border-style: groove; border-width: thin" align="center" valign="middle">
                    <a onclick="javascript:openDistrict(true); return false;" tabindex="7">Trust Districts</a>                    
                </td>
                <td align="right" style="border-style: none none groove none; border-width: thin">
                    <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="Save" TabIndex="5"/>&nbsp;
                    <asp:Button ID="btnBack" runat="server" Text="Back" PostBackUrl="../Views/RegionList.aspx" TabIndex="6"/>&nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="3" style="border-style: none groove groove groove; border-width: thin">
                    <table width="100%" >
                        <tr>
                            <td width="15%">Nation/Country <font color="red">*</font></td>
                            <td>
                                <asp:DropDownList ID="listCountry" runat="server" TabIndex="1" Width="300px"></asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>Trust Region Name <font color="red">*</font></td>
                            <td>
                                <asp:TextBox ID="txtRegionName" runat="server" TabIndex="2" Width="300px"></asp:TextBox>
                                <asp:Label ID="lbMessage" runat="server" ForeColor="Red"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>Description</td>
                            <td>
                                <asp:TextBox ID="txtDescription" runat="server" TabIndex="3" Width="300px" Height="100px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>Is Active?</td>
                            <td>
                                <asp:CheckBox ID="cbActive" runat="server" TabIndex="4"></asp:CheckBox>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>           
        </table>

        <table width="100%" cellspacing="0" id="table2" style="display:none">
            <tr>
                <td colspan="3" style="font-size:large; color:green">Trust Region Details</td>
            </tr>
            <tr><td>&nbsp;</td></tr>
            <tr>
                <td width="6%" style="border-width: thin; border-style: groove;" align="center" valign="middle">
                    <a onclick="javascript:openDistrict(false); return false;" >Details</a>
                </td>
                <td width="10%" style="border-style: groove groove hidden groove; border-width: thin" align="center" valign="middle">Trust Districts</td>
                <td align="right" style="border-style: hidden hidden groove hidden; border-width: thin">
                    <asp:Button ID="btnBack2" runat="server" Text="Back" PostBackUrl="../Views/RegionList.aspx"/>&nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="3" style="border-style: hidden groove groove groove; border-width: thin">
                    <table width="100%">
                        <tr>
                            <td width="60%">
                                <asp:LinkButton ID="link1" ForeColor="Blue" runat="server" Text="All" CssClass="style1" Onclick="GetAllRegionDistrict"/>&nbsp;|&nbsp;
                                <asp:LinkButton ID="link2" ForeColor="Blue" runat="server" Text="0-9" CssClass="style1" Onclick="Filter09"/>&nbsp;|&nbsp;
                                <asp:LinkButton ID="link3" ForeColor="Blue" runat="server" Text="A B C D E" CssClass="style1" Onclick="FilterAE"/>&nbsp;|&nbsp;
                                <asp:LinkButton ID="link4" ForeColor="Blue" runat="server" Text="F G H I J" CssClass="style1" Onclick="FilterFJ"/>&nbsp;|&nbsp;
                                <asp:LinkButton ID="link5" ForeColor="Blue" runat="server" Text="K L M N" CssClass="style1" Onclick="FilterKN"/>&nbsp;|&nbsp;
                                <asp:LinkButton ID="link6" ForeColor="Blue" runat="server" Text="O P Q R" CssClass="style1" Onclick="FilterOR"/>&nbsp;|&nbsp;
                                <asp:LinkButton ID="link7" ForeColor="Blue" runat="server" Text="S T U V" CssClass="style1" Onclick="FilterSV"/>&nbsp;|&nbsp;
                                <asp:LinkButton ID="link8" ForeColor="Blue" runat="server" Text="W X Y Z" CssClass="style1" Onclick="FilterWZ"/>&nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                            <td align="right">                        
                                <asp:Button ID="btnCreate" runat="server" Text="Create" OnClick="BtnCreateClick"/>&nbsp;
                                <asp:CheckBox ID="cbInActive" runat="server" Text="Include In-active" OnCheckedChanged="GetAllRegionDistrict"  AutoPostBack="true"/>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:GridView ID="grvDistrict" runat="server" Width="100%" OnPageIndexChanging="PageChanging"
                                    AutoGenerateColumns="False"                 
                                    ShowHeaderWhenEmpty="true" 
                                    EnableModelValidation="True"
                                    AllowPaging="True" PageSize ="5" > 
                                    <Columns>
                                        <asp:HyperLinkField HeaderText="District Name" DataTextField="Name" 
                                            ControlStyle-ForeColor="Blue" 
                                            DataNavigateUrlFields="ID" 
                                            DataNavigateUrlFormatString="../Forms/DistrictDetail.aspx?did={0}"
                                            HeaderStyle-Width="25%" HeaderStyle-Height="20pt">
                                        </asp:HyperLinkField>
                                        <asp:BoundField HeaderText="Description" DataField="Description" HeaderStyle-Width="40%"/>
                                        <asp:BoundField HeaderText="Region" DataField="Region" HeaderStyle-Width="25%"/>
                                        <asp:BoundField HeaderText="Is Active?" DataField="Active" />
                                    </Columns>
                                </asp:GridView>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>           
        </table>
        <script type="text/javascript">

            OnLoad();
            function OnLoad() {
                document.getElementById("ctl00_MainContent_listCountry").focus();
            }

            function openDistrict(flag) {
                var district = document.getElementById('table2');
                var region = document.getElementById('table1');

                if (flag) {
                    district.style.display = "table";
                    region.style.display = "none";
                }
                else {
                    district.style.display = "none";
                    region.style.display = "table";
                }              
                
            }
        </script>
    </div>    
</asp:Content>



